package domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

public class Student {
    private Integer id;

    private String name;

    private String code;

    private String password;

    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date birth;

    private String className;

    public Student(Integer id, String name, String code, String password, Date birth, String className) {
        this.id = id;
        this.name = name;
        this.code = code;
        this.password = password;
        this.birth = birth;
        this.className = className;
    }
    public Student(String name, String code, String password, Date birth, String className) {
        this.name = name;
        this.code = code;
        this.password = password;
        this.birth = birth;
        this.className = className;
    }

    public Student() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className == null ? null : className.trim();
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", password='" + password + '\'' +
                ", birth=" + birth +
                ", className='" + className + '\'' +
                '}';
    }
}